package com.coscon.utils.thymeleafTaglib;

import org.thymeleaf.dialect.AbstractProcessorDialect;
import org.thymeleaf.processor.IProcessor;
import org.thymeleaf.standard.StandardDialect;
import org.thymeleaf.standard.processor.StandardXmlNsTagProcessor;
import org.thymeleaf.templatemode.TemplateMode;

import java.util.HashSet;
import java.util.Set;




public class IrcaUiDialect extends AbstractProcessorDialect{

    /**
     * 定义方言名称
     */
    private static final String DIALECT_NAME = "Irca Dialect";

    public IrcaUiDialect() {
        super(DIALECT_NAME,"Irca",StandardDialect.PROCESSOR_PRECEDENCE);
    }

    protected IrcaUiDialect(String name, String prefix, int processorPrecedence) {
        // 我们将设置此方言与“方言处理器”优先级相同
        // 标准方言, 以便处理器执行交错。Epanasia 自定义标签的名称 在html 是这样写的 <Simp2:matter matterid="7"/>
        super(name, prefix, processorPrecedence);
    }

    @Override
    public Set<IProcessor> getProcessors(final String dialectPrefix) {
        Set<IProcessor> processors = new HashSet<>();
        // 添加我们定义的标签
        processors.add(new IrcaButtonTag(dialectPrefix));
        return processors;
    }


}
